//
//  YW_NetworkManager.h
//  ZKChargingPile
//
//  Created by 陈友文 on 2021/1/22.
//  Copyright © 2021 陈友文. All rights reserved.
//

#import "AFHTTPSessionManager.h"

NS_ASSUME_NONNULL_BEGIN

@interface YW_NetworkManager : AFHTTPSessionManager

typedef NS_ENUM(NSInteger, YWNetWorkType) {
    YWNetWorkTypeGET = 0,
    YWNetWorkTypePOST = 1,
    YWNetWorkTypePUT = 2,
    YWNetWorkTypeDELETE = 3,
    
};

typedef void(^yw_completionBlock)(id _Nullable result,BOOL requestStatus,AFNetworkReachabilityStatus reachabilityStatus);
typedef void(^yw_successBlock)(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject);
typedef void(^yw_failBlock)(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error);


+(instancetype)shareManager;



/// 普通请求
/// @param type 请求类型
/// @param URLString 请求URL
/// @param parameters 请求参数
/// @param headers 请求头
/// @param completionBlock 回调
-(void)yw_networkType:(YWNetWorkType)type
             urlString:(NSString *)URLString
            parameters:(id)parameters
                header:(nullable NSDictionary <NSString *, NSString *> *)headers
            completion:(yw_completionBlock)completionBlock;

/// 上传图片
/// @param URLString 请求URL
/// @param parameter 请求参数
/// @param imageArr 请求图片数组
/// @param headers 请求头
/// @param completionBlock 回调
-(void)yw_upImageUrl:(NSString *)URLString
        parameter:(NSDictionary *)parameter
         imageArr:(NSArray *)imageArr
           header:(nullable NSDictionary <NSString *, NSString *> *)headers
       completion:(yw_completionBlock)completionBlock;

@end

NS_ASSUME_NONNULL_END
